package com.wyh.cloud.handler;

import cn.hutool.core.lang.UUID;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;
import pojo.CommonResult;

/**
 * @author wyh
 * @version 1.0
 * @date 2021/11/26 9:36
 */
@Slf4j
public class CustomerBlockHandler {

    public static CommonResult HandlerException(BlockException exception){
        String serial = UUID.randomUUID().toString();
        log.warn(444 + "访问异常 " + exception + "---" + serial);
        return new CommonResult(4444, "访问异常,跳转自定义handler --HandlerException" + exception + "---" + serial);
    }

    public static CommonResult HandlerException2(BlockException exception){
        String serial = UUID.randomUUID().toString();
        log.warn(444 + "访问异常 " + exception + "---" + serial);
        return new CommonResult(4444, "访问异常,跳转自定义handler --HandlerException2" + exception + "---" + serial);
    }
}
